<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="imports.jsp" %>
<html>

<head>

				 			<script type="text/javascript">
function submitform()
{
    document.forms["myform"].submit();
}

function confirmation(id,username) {
	var answer = confirm("Voulez-vous supprimer "+username+" ?");
	if (answer){
		alert(username+" supprimé");
		window.location = "ModifUser?act=del&id="+id+"";
		
	}
	
}



</script>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" media="screen" type="text/css" title="style" href="style.css"/>
	<title>Super mega site d'e-commerce de livres</title>
</head>
<body>
<c:if test="${sessionUser.role != 'ADMIN'}">
   <jsp:forward page="/m" />
</c:if>
<div id="wrapper">
	<div id="header">
		<div id="logo">
		<h1>e-commerce de livres</h1>
		
			
		</div>
		
	</div>
	<!-- end #header -->
	<div id="menu">
			<jsp:include page="header.jsp"/>
	</div>
	<!-- end #menu -->
	<div id="page">
	<div id="page-bgtop">
	<div id="page-bgbtm">
	
	
		<div id="content">
		
			<div class="post">
				<h2 class="title">Liste utilisateurs</h2>
				<div class="entry">
				<table style="width: 100%;padding-left: 5px;padding-top: 5px" >
				<tr>
					<th style="width: 40px;">id</th>
					<th style="width: 75px;">User Name</th>
				 	<th style="width: 75px;">First Name</th>
				 	<th style="width: 75px;">Last Name</th>
				 	<th style="width: 25px;">Email</th>
				 	<th style="width: 50px;">Droits</th>
				 	<th style="width: 40px;"></th>
				 </tr>	
					
					
					
					
					<c:forEach var="user" items="${users}">
					
			
				<tr>
					<td style="width: 15px;"> ${user.id}	</td>
					<td style="width: 25px;"> ${user.username}</td>
				 	<td style="width: 25px;"> ${user.firstname}	</td>
				 	<td style="width: 25px;"> ${user.lastname}	</td>
				 	<td style="width: 25px;"> ${user.email}</td>
				 	<td style="width: 25px;"> ${user.role}</td>
				 	<td style="width: 25px;"><a href="ModifUser?act=edit&id=${user.id}"><img width="16px" src="images/style/modifier.png"></a>&nbsp;&nbsp;<a onclick="confirmation('${user.id}','${user.username}')" href=""><img src="images/style/supprimer.png"></a></td>
				 </tr>
			
		
					</c:forEach>
					</table>
					</div>
					
					
			</div>
			
		<div style="clear: both;">&nbsp;</div>
		</div>
		<!-- end #content -->
		<div id="sidebar">
			<ul>
				<jsp:include page="admin.jsp"/>
				<jsp:include page="categories.jsp"/>
			</ul>
		</div>
		<!-- end #sidebar -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	</div>
	<!-- end #page -->
</div>
	<div id="footer">
		<p>Copyright (c) 2011. All rights reserved.</p>
	</div>
	<!-- end #footer -->

</body>
</html>





	














